import { request } from '@/utils';
import { getRestBaseUrl } from '@/config';

// 查询
export const loadListStore = (queryForm, page = { pageSize: 10, pageNum: 1 }) =>
  request({
    url: `${getRestBaseUrl()}/iop/scriptService/listPage`,
    method: 'POST',
    data: {
      scriptForm: queryForm,
      page,
    },
    timeout: 3 * 60 * 1000,
  });

// 启用
export const enable = id =>
  request({
    url: `${getRestBaseUrl()}/iop/scriptService/enable`,
    method: 'POST',
    data: { id: id },
    timeout: 3 * 60 * 1000,
  });

// 禁用
export const disable = id =>
  request({
    url: `${getRestBaseUrl()}/iop/scriptService/disable`,
    method: 'POST',
    data: { id: id },
    timeout: 3 * 60 * 1000,
  });
